import { _decorator, AudioClip, Component, director, instantiate, Node, Prefab, sys } from 'cc';
import { BallController } from './BallController';
import { PRIVACY_POLLICY_SWITCH } from './Define';
const { ccclass, property } = _decorator;




@ccclass('GameManager')
export class GameManager extends Component {
	@property(BallController)
	public ballController: BallController = null


	@property(Prefab)
	public safeLayerPrefab: Prefab = null



   

	start() {
		this.ballController.node.on('gameOver', this.onGameOver, this)
		this.node.active = false

	}

	restartGame() {
		this.loadScene()
	}

	loadScene() {
		director.loadScene(director.getScene().name)
		console.log("GameManager:" + sys.localStorage.getItem("PRIVACY_POLLICY_SWITCH_STRING"))
		
	}

	onGameOver() {
		this.node.active = true
    }
    
}


